package controller.game.player;

import entity.CounterMessage;
import entity.Message;
import entity.offer.Offer;
import sun.java2d.SurfaceDataProxy;

public abstract class Agent extends Player{

    @Override
    public void receiveMessage(Message message) {
        if(message instanceof CounterMessage){
            CounterMessage counterMessage = (CounterMessage) message;
            this.receiveCounterMessage(counterMessage);
        }
    }

    @Override
    public CounterMessage sendMessage() {
        CounterMessage counterMessage = new CounterMessage(this.playerNum, this.roomNum);
        counterMessage.setBody(proposeOffer());
        return counterMessage;
    }

    public abstract void receiveCounterMessage(CounterMessage counterMessage);

    public abstract Offer proposeOffer();

}
